import request from '@/utils/request'

// 查询检测类别库列表
export function listJclb(query) {
  return request({
    url: '/lims/store/jclb/list',
    method: 'get',
    params: query
  })
}

// 查询检测类别库列表(不带分页)
export function allListJclb() {
  return request({
    url: '/lims/store/jclb/jclbList?typeId=1',
    method: 'get',
  })
}

// 查询检测类别库列表(不带分页)
export function shareJclbList() {
  return request({
    url: '/system/org/jclbList?typeId=1',
    method: 'get',
  })
}

// 查询检测类别库列表(不带分页)
export function pJclbIdByJclb(query) {
  return request({
    url: '/lims/store/jclb/jclbList',
    method: 'get',
    params: query
  })
}

// 根据project查询检测类别库列表(不带分页)
export function projectListJclb(query) {
  return request({
    url: '/lims/project/jcxm/jclbList',
    method: 'get',
    params: query
  })
}

// 查询检测类别组列表(不带分页)
export function allListJclbGroup(fixer) {
  let url = '/lims/store/jclb/jclbGroupList';
  if(fixer){
    url += "?fixer=1"
  }
  return request({
    url: url,
    method: 'get',
  })
}

// 查询检测类别库详细
export function getJclb(jclbId) {
  return request({
    url: '/lims/store/jclb/' + jclbId,
    method: 'get'
  })
}

// 计量单位库同步
export function postJclb() {
  return request({
    url: '/lims/store/jclb/syn',
    method: 'post',
    timeOutValidate: false,
  })
}

// 计量单位库同步属性
export function postJclbAttribute() {
  return request({
    url: '/lims/store/jclb/property/syn',
    method: 'post',
    timeOutValidate: false,
  })
}

// 计量单位库同步缓存
export function getJclbStatus() {
  return request({
    url: '/lims/store/jclb/status',
    method: 'get',
  })
}

// 查询检测类别库详细
export function getSxJclb(query) {
  return request({
    url: '/lims/store/jclb/propertyList',
    method: 'get',
    params: query
  })
}

// 根据检测类别获取检测项目组
export function jclbByJcxmGroup(id) {
  return request({
    url: '/lims/dataRule/groupList/' + id,
    method: 'get',
  })
}

// 保存检测代码
export function saveJclbCode(data) {
  return request({
    url: '/lims/store/jclb/update',
    method: 'post',
    data: data
  })
}
